﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using System.Xml.Serialization;

namespace FileCopy
{
    [Serializable]
    public class f_Filter
    {
        [XmlAttribute("Filter")]
        public string FilterWord { get; set; }

        public f_Filter(string filter)
        {
            this.FilterWord = filter;
        }

        public f_Filter()
            : this(null)
        { }

        public bool CheckValid(string fileName)
        {
            if (this.FilterWord != null && fileName.Contains(this.FilterWord))
                return true;
            return false;
        }

        public override string ToString()
        {
            return FilterWord;
        }
    }
}
